package com.example.easypoi.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.easypoi.dao.UserMapper;
import com.example.easypoi.entity.User;
import com.example.easypoi.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public IPage<User> getList(String name, Integer page, Integer limit) {
        List<User> list = userMapper.getList(name, page, limit);
        Page<User> userPage = new Page<>();
        userPage.setRecords(list);
        return userPage;
    }
}
